﻿<%@ WebHandler Language="C#" Class="Bind" %>

using System.Web;
using System.Collections.Generic;

public class Bind : IHttpHandler {

    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        List<string> sqllist = new List<string>();
        string result = null;
        sqllist.Add(context.Request.Params["sql1"].ToString());
        sqllist.Add(context.Request.Params["sql2"].ToString());
        DB DBConn = new DB();
        List<string> r= DBConn.BindTransaction(sqllist);
        foreach (string L in r)
        {
            if (result == null) { result += L;} else { result += ","+L;}
        }
        result = "{" + result + "}";
        context.Response.Write(result);
        DBConn.mysqlcon.Close();
        //context.Response.Buffer = false;
        //context.Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-10);
        //context.Response.Expires = 0;
        //context.Response.CacheControl = "no-cache";
        context.Response.Flush();
        context.Response.End();
    }

    public bool IsReusable {
        get {
            return false;
        }
    }

}